package cn.orangelite.ai.service.impl;

import java.util.List;
import cn.orangelite.common.core.utils.DateUtils;
import cn.orangelite.common.datascope.annotation.DataScope;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.orangelite.ai.mapper.AiPluginsMapper;
import cn.orangelite.ai.domain.AiPlugins;
import cn.orangelite.ai.service.IAiPluginsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 插件列Service业务层处理
 * 
 * @author dongfaqing
 * @date 2024-01-18
 */
@Service
public class AiPluginsServiceImpl extends ServiceImpl<AiPluginsMapper,AiPlugins> implements IAiPluginsService
{
    @Autowired
    private AiPluginsMapper aiPluginsMapper;

    /**
     * 查询插件列
     * 
     * @param id 插件列主键
     * @return 插件列
     */
    @Override
    public AiPlugins selectAiPluginsById(Integer id)
    {
        return aiPluginsMapper.selectAiPluginsById(id);
    }

    /**
     * 查询插件列列表
     * 
     * @param aiPlugins 插件列
     * @return 插件列
     */
    @Override
    @DataScope(userAlias = "u")
    public List<AiPlugins> selectAiPluginsList(AiPlugins aiPlugins)
    {
        return aiPluginsMapper.selectAiPluginsList(aiPlugins);
    }

    /**
     * 新增插件列
     * 
     * @param aiPlugins 插件列
     * @return 结果
     */
    @Override
    public int insertAiPlugins(AiPlugins aiPlugins)
    {
        aiPlugins.setCreateTime(DateUtils.getNowDate());
        return aiPluginsMapper.insertAiPlugins(aiPlugins);
    }

    /**
     * 修改插件列
     * 
     * @param aiPlugins 插件列
     * @return 结果
     */
    @Override
    public int updateAiPlugins(AiPlugins aiPlugins)
    {
        return aiPluginsMapper.updateAiPlugins(aiPlugins);
    }

    /**
     * 批量删除插件列
     * 
     * @param ids 需要删除的插件列主键
     * @return 结果
     */
    @Override
    public int deleteAiPluginsByIds(Integer[] ids)
    {
        return aiPluginsMapper.deleteAiPluginsByIds(ids);
    }

    /**
     * 删除插件列信息
     * 
     * @param id 插件列主键
     * @return 结果
     */
    @Override
    public int deleteAiPluginsById(Integer id)
    {
        return aiPluginsMapper.deleteAiPluginsById(id);
    }
}
